package com.gem.growingtree.activity;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.HashMap;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import com.lidroid.xutils.view.annotation.event.OnItemClick;

import android.R.anim;
import android.os.Bundle;
import android.app.ListActivity;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
public class PlayListActivity extends ListActivity {
/*	private ListView listView;*/
	@ViewInject(R.id.PL_image_id)
	private ImageButton image;
	@OnClick(R.id.PL_image_id)
	public void onClickBack(View v){
		Intent intent=new Intent();
		intent.setClass(PlayListActivity.this, TodayPlayActivity.class);
		startActivity(intent);
	}
	/*@ViewInject(R.id.PL_TV_id2)
	private ListView listView;
	@OnClick(R.id.PL_TV_id2)
	public void onClickTextView(View v){
		Intent intent=new Intent();
		intent.setClass(PlayListActivity.this, PlayDetailActivity.class);
		startActivity(intent);
	}*/
	private ArrayList<HashMap<String,Object>> list = new ArrayList<HashMap<String,Object>>();
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_play_list);
		ViewUtils.inject(this);
		listPut();
		ListView listView=getListView();
		listView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				Intent intent=new Intent();
				intent.setClass(PlayListActivity.this,PlayDetailActivity.class);
				startActivity(intent);
			}
		});
	}
	public void listPut(){
		HashMap<String,Object> map1=new HashMap<String, Object>();
		HashMap<String, Object> map2=new HashMap<String, Object>();
		HashMap<String, Object> map3=new HashMap<String, Object>();
		map1.put("PL_TV_years", "12月18日");
		map1.put("PL_image_head", R.drawable.head);
		map1.put("PL_TV_works", "手工任务");
		map1.put("PL_TV_detail", "查看详情");
		map1.put("PL_TV_hours", "14:00");
		
		map2.put("PL_TV_years", "12月20日");
		map2.put("PL_image_head", R.drawable.head);
		map2.put("PL_TV_works", "背书任务");
		map2.put("PL_TV_detail", "查看详情");
		map2.put("PL_TV_hours", "18:00");
		
		map3.put("PL_TV_years", "11月20日");
		map3.put("PL_image_head", R.drawable.head);
		map3.put("PL_TV_works", "画画任务");
		map3.put("PL_TV_detail", "查看详情");
		map3.put("PL_TV_hours", "13:00");
		
	    list.add(map1);
	    list.add(map2);
	    list.add(map3);
		SimpleAdapter listAdapter1=new SimpleAdapter(this, list,R.layout.playlist_item , 
				new String[]{"PL_TV_years","PL_image_head","PL_TV_works","PL_TV_detail","PL_TV_hours"}, 
				new int[]{R.id.PL_TV_id,R.id.PL_image_id,R.id.PL_TV_id1,R.id.PL_TV_id2,R.id.PL_TV_id3});
		setListAdapter(listAdapter1);
		}
	 }

	  

